﻿// -----------------------------------------------------------------------
// <copyright file="IBookDataProvider.cs" company="EPAM Systems">
////Copyright (c) EPAM Systems, 2012. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace MBOP.Core.Interfaces.DataProviders
{
	#region Usings

	using System.Collections.Generic;
	using MBOP.Core.Entities.Library;
	using MBOP.Core.Interfaces.Common;

	#endregion

	/// <summary>
	/// Provides the common interface of the book database operations.
	/// </summary>
	public interface IBookDataProvider
	{
		#region Methods

		/// <summary>
		/// Adds book to database.
		/// </summary>
		/// <param name="newBook">The book.</param>
		void AddBook(Book newBook);

		/// <summary>
		/// Deletes book from database.
		/// </summary>
		/// <param name="bookID">The book id</param>
		/// <returns>The book id.</returns>
		int DeleteBook(int bookID);

		/// <summary>
		/// Updates book in the database.
		/// </summary>
		/// <param name="bookToUpdate">The book.</param>
		void UpdateBook(Book bookToUpdate);

		/// <summary>
		/// Gets the count of books in library by the specific filter.
		/// </summary>
		/// <param name="bookFilter">The book filter.</param>
		/// <returns>The count of elements in the sequence.</returns>
		int GetBookCount(IFilter<Book> bookFilter);

		/// <summary>
		/// Gets books from database.
		/// </summary>
		/// <param name="skipCount">The number of skipping books.</param>
		/// <param name="takeCount">The number of taking books.</param>
		/// <param name="bookFilter">The book filter.</param>
		/// <returns>The books collection</returns>
		IEnumerable<Book> GetBooks(int skipCount, int takeCount, IFilter<Book> bookFilter);

		/// <summary>
		/// Gets the book by id.
		/// </summary>
		/// <param name="id">The book id</param>
		/// <returns>The book.</returns>
		Book GetBookByID(int id);

		/// <summary>
		/// Adds subscription to database.
		/// </summary>
		/// <param name="bookSubscription">The book subscription.</param>
		void AddSubscription(BookSubscription bookSubscription);

		/// <summary>
		/// Deletes all person subscription from current book.
		/// </summary>
		/// <param name="subscriptionSet">The subscription set</param>
		/// <param name="bookID">The book id</param>
		void DeletePersonSubscriptions(string subscriptionSet, int bookID);

		/// <summary>
		/// Gets the book subscriptions.
		/// </summary>
		/// <param name="bookID">The book id.</param>
		/// <returns>The book subscriptions collection</returns>
		IEnumerable<BookSubscription> GetBooksSubscription(int bookID);

		#endregion
	}
}
